package com.pizza.abstrait;

import java.io.Serializable;

import javax.faces.component.html.HtmlCommandButton;

import com.pizza.model.Article;

/**
 * Class AbstractCommandeLigneArticle
 *
 */
public class AbstractCommandeLigneArticle implements Serializable {

	protected AbstractArticle article;

	protected int quantite;

	protected float prix;

	protected AbstractCommande commande;
		
	public AbstractArticle getArticle() {
		return article;
	}

	public void setArticle(AbstractArticle article) {
		this.article = article;
	}

	public float getPrix() {
		return prix;
	}

	public void setPrix(float prix) {
		this.prix = prix;
	}

	public int getQuantite() {
		return quantite;
	}

	public void setQuantite(int quantite) {
		this.quantite = quantite;
		this.prix = this.article.getPrix() * this.quantite;
	}
	

	public AbstractCommande getCommande() {
		return commande;
	}

	public void setCommande(AbstractCommande commande) {
		this.commande = commande;
	}
	
	public void suppressionCommande() {
		getCommande().removeArticle(this);
	}
	
}
